def bubble_sort(array):
    n = len(array)
    for i in range(n):
        for j in range(0, n-i-1):
            if array[j] > array[j+1]:
                array[j], array[j+1] = array[j+1], array[j]
    return array

# 示例
arr = [64, 34, 25, 12, 22, 11, 90]
print("排序前的数组：", arr)
print("排序后的数组：", bubble_sort(arr))